﻿using System;
using System.Collections.Generic;
using System.Text;


public class NetHandler_Ping: NetMessageHandler
{
    public static NetHandler_Ping NewHandler()
    {
        return new NetHandler_Ping();
    }

    protected override ISerialize NewData() => new PingRequest(); 
        

    public override void Execute(Remote remote,ISerialize _data)
    {
        PingRequest pingData = _data as PingRequest;

        GameDebug.Log($"收到ping  客户端发送时间：{pingData.clientSendTime}");

        PingResponse pingResponse = new PingResponse();

        pingResponse.serverReceiveTime = CommonFunctions.GetTimeStamp();

        byte[] data = pingResponse.Write();

        this.SendResponse(remote, "NetRequest_Ping", this.m_MessageReceived.seq, data);
    }

}

